/*
 * ClassStruct.h
 *
 *  Created on: 21/nov/2010
 *      Author: computer
 */

#ifndef CLASSSTRUCT_H_
#define CLASSSTRUCT_H_
#include <list>
#include <string>
#include "FlowExpression.h"

namespace TreeExpression {

class ClassStruct: public virtual FlowExpression {
public:
	ClassStruct(const std::string&);
	ClassStruct(const ClassStruct&);
	virtual ~ClassStruct();

	void addDataMember(const AutoPointer<Expression>&, const std::string&, int);
	void addMemberFunction(const AutoPointer<Expression>&, const std::string&, int);
	AutoPointer<Expression> getDataMember(const std::string&, int) const;
	std::list < AutoPointer<Expression> > getMemberFunction(const std::string&, int) const;

	AutoPointer<Expression> call(const std::string&, int, CopyPointer<Context>&);

	enum ACCESS {PRIVATE = 1, PROTECTED, PUBLIC};

	virtual std::string toString() const;
	virtual std::string getHash() const;
private:
	/*struct DataMember {
		DataMember(const AutoPointer<Expression>& _data, const std::string& _name, int _access) : data(_data), name(_name), access(_access) { }
		AutoPointer<Expression> data;
		std::string name;
		int access;
	};

	struct MemberFunction {
		MemberFunction(const AutoPointer<Expression>& _data, const std::string& _name, int _access) : data(_data), name(_name), access(_access) { }
		AutoPointer<Expression> data;
		std::string name;
		int access;
	};

	std::list< DataMember > listDataMember;
	std::list< MemberFunction > listMemberFunction;*/
	CopyPointer<Context> publicContext;
	CopyPointer<Context> protectedContext;
	CopyPointer<Context> privateContext;
	std::string name;
};

}

#endif /* CLASSSTRUCT_H_ */
